package com.lin.filegraph.utils.parser.astutil;

import org.eclipse.jdt.core.dom.CompilationUnit;

/**
 * @description:
 * @author: linhuaixu
 * @time: 2023/5/18 14:04
 */
public class CompileUnit {
    private String fileName;
    private String filePath;
    private CompilationUnit compilationUnit;
    public CompileUnit(String filePath, CompilationUnit compilationUnit) {
        this.filePath = filePath;
        this.fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.lastIndexOf("."));
        this.compilationUnit = compilationUnit;
    }
    public String getFilePath() {
        return filePath;
    }
    public String getFileName() {
        return fileName;
    }
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }
    public CompilationUnit getCompilationUnit() {
        return compilationUnit;
    }
    public void setCompilationUnit(CompilationUnit compilationUnit) {
        this.compilationUnit = compilationUnit;
    }
    public void release() {
        filePath = null;
        compilationUnit = null;
    }
}
